<h4>活动基础信息</h4>
<hr class="hr-line-solid">

<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>活动名称：</label>
    <div class="col-sm-10">
        <input type="text" class="form-control" required name="base[title]" placeholder="" value="{{$discount->activity_name}}"/>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>成团名称：</label>
    <div class="col-sm-10">
        <input type="text" class="form-control" required name="base[alias]" placeholder="" value="{{$discount->alias}}"/>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>拼团商品价钱：</label>
    <div class="col-sm-5">
        <input type="number" step="0.01" class="form-control" name="base[activity_price]" placeholder="" value="{{$discount->activity_price}}" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>拼团商品运费：</label>
    <div class="col-sm-2">
        <input type="number" step="0.01" class="form-control" name="base[freight]" placeholder="" value="{{$discount->freight}}"/>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>成团人数：</label>
    <div class="col-sm-2">
        <input type="number" step="0.01" class="form-control" name="base[activity_num]" placeholder=""  value="{{$discount->activity_num}}"/>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>成团数限制：</label>
    <div class="col-sm-2">
        <input type="number" step="0.01" class="form-control" name="base[team_num]" placeholder=""  value="{{$discount->team_num}}"/>
    </div>
</div>
{{--<div class="form-group">
    <label class="col-sm-2 control-label">排优惠券 <i class="fa fa-question-circle"
                                                  data-toggle="tooltip" data-placement="top"
                                                  data-original-title="设置“是”后在下单时选择促销活动后，不能选择优惠券"></i>：</label>
    <div class="col-sm-10">
        <label class="checkbox-inline i-checks"><input name="base[exclusive]" type="radio" value="0" {{$discount->exclusive == 0?'checked' : ''}}> 否</label>
        <label class="checkbox-inline i-checks"><input name="base[exclusive]" type="radio" value="1" {{$discount->exclusive == 1?'checked' : ''}}> 是</label>
    </div>
</div>--}}

{{--<div class="form-group">
    <label class="col-sm-2 control-label">规则：</label>
    <div class="col-sm-10">
        <input type="text" class="form-control" name="base[label]" placeholder="" value="{{$discount->label}}"/>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">使用说明：</label>
    <div class="col-sm-10">
        <textarea class="form-control" name="base[intro]" rows="4">{{$discount->intro}}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label"><span class="sp-require">*</span>使用数量：</label>
    <div class="col-sm-10">
        <input type="text" class="form-control" name="base[usage_limit]" placeholder="" required
               value="{{$discount->usage_limit}}"/>
    </div>
</div>--}}

<div class="form-group" id="two-inputs">
    <label class="col-sm-2 control-label">活动时间：</label>
    <div class="col-sm-3">
        <div class="input-group date form_datetime">
                                        <span class="input-group-addon" style="cursor: pointer">
                                            <i class="fa fa-calendar"></i>&nbsp;&nbsp;开始</span>
            <input type="text" name="base[starts_at]" class="form-control inline" id="date-range200" size="20" value="{{$discount->start_time}}"
                   placeholder="点击选择时间" readonly>
            <span class="add-on"><i class="icon-th"></i></span>
        </div>
        <div id="date-range12-container"></div>
    </div>

    <div class="col-sm-3">
        <div class="input-group date form_datetime">
                                        <span class="input-group-addon" style="cursor: pointer">
                                            <i class="fa fa-calendar"></i>&nbsp;&nbsp;截止</span>
            <input type="text" name="base[ends_at]" class="form-control inline" id="date-range201" value="{{$discount->end_time}}"
                   placeholder="" readonly>
            <span class="add-on"><i class="icon-th"></i></span>
        </div>
    </div>
</div>


<div class="form-group">
    <label class="col-sm-2 control-label">状态：</label>
    <div class="col-sm-10">
        <label class="checkbox-inline i-checks"><input name="base[status]" type="radio"
                                                       value="1" {{$discount->is_valid == 1?'checked' : ''}}> 启用</label>
        <label class="checkbox-inline i-checks"><input name="base[status]" type="radio"
                                                       value="0" {{$discount->is_valid == 0?'checked' : ''}}> 禁用</label>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-2 control-label">重复购买：</label>
    <div class="col-sm-10">
        <label class="checkbox-inline i-checks"><input name="base[is_repeat]" type="radio"
                                                       value="1" {{$discount->is_repeat == 1?'checked' : ''}}> 启用</label>
        <label class="checkbox-inline i-checks"><input name="base[is_repeat]" type="radio"
                                                       value="0" {{$discount->is_repeat == 0?'checked' : ''}}> 禁用</label>
    </div>
</div>
<!--指定产品-->
@if($contains_product=$discount->discount_contains_product)
    <div class="form-group">
        <label class="col-sm-2 control-label">SKU：</label>
        <div class="col-sm-10 col-sm-offset-2">
            {{--<label>
                <input type="checkbox" value="contains_product" name="rules[3][type]" class="switch-input"> 指定产品
            </label>--}}
            <fieldset class="sw-value">
                <div class="form-group">
                    <div class="col-sm-10">
<textarea style="height: 100px" class="form-control  col-sm-10"
          name="rules[3][value][sku]">{{($discount->contains_product['sku']) }}</textarea>

                        <label>输入商品SKU值，用英文逗号隔开</label>
                    </div>
                </div>
            </fieldset>
        </div>
    </div>
@else
    <div class="form-group">
        <div class="col-sm-10 col-sm-offset-2">
            <label>
                <input type="checkbox" value="contains_product" name="rules[3][type]" class="switch-input"> 指定产品
            </label>

            <fieldset class="sw-value" style="display: none;">
                <div class="form-group">
                    <label class="col-sm-2 control-label">SKU：</label>
                    <div class="col-sm-10">
<textarea style="height: 200px" class="form-control  col-sm-10"
          name="rules[3][value][sku]"></textarea>

                        <label>输入产品SKU值，每行一个</label>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">SPU：</label>
                    <div class="col-sm-10">
                        <a class="btn btn-success" id="chapter-create-btn" data-toggle="modal"
                           data-target="#spu_modal" data-backdrop="static" data-keyboard="false"
                           data-url="{{route('admin.promotion.getSpu',['action' => 'add'])}}">
                            点击添加商品
                        </a>
                        (已添加
                        <i class="countSpu">0</i>
                        个商品，<a data-toggle="modal"
                               data-target="#spu_modal" data-backdrop="static" data-keyboard="false"
                               data-url="{{route('admin.promotion.getSpu', ['action' => 'view'])}}">点击查看</a>)

                        <input type="hidden" id="selected_spu" name="rules[3][value][spu]" value="">

                    </div>
                </div>
            </fieldset>
        </div>
    </div>
@endif
<div class="form-group">
    <label class="col-sm-2 control-label">活动参与人数：</label>
    <div class="col-sm-10 col-sm-offset-2">
        {{--<label>
            <input type="checkbox" value="contains_product" name="rules[3][type]" class="switch-input"> 指定产品
        </label>--}}
        <fieldset class="sw-value">
            <div class="form-group">
                <div class="col-sm-10">
<textarea style="height: 100px" class="form-control  col-sm-10"
          name="rules[3][value][join_num]">{{$discount->join_nums}}</textarea>

                    <label>输入商品参与人数值，用英文逗号隔开</label>
                </div>
            </div>

            {{--<div class="form-group">
                <label class="col-sm-2 control-label">SPU：</label>
                <div class="col-sm-10">
                    <a class="btn btn-success" id="chapter-create-btn" data-toggle="modal"
                       data-target="#spu_modal" data-backdrop="static" data-keyboard="false"
                       data-url="{{route('admin.promotion.getSpu',['action' => 'add'])}}">
                        点击添加商品
                    </a>
                    (已添加
                    <i class="countSpu">0</i>
                    个商品，<a data-toggle="modal"
                           data-target="#spu_modal" data-backdrop="static" data-keyboard="false"
                           data-url="{{route('admin.promotion.getSpu', ['action' => 'view'])}}">点击查看</a>)

                    <input type="hidden" id="selected_spu" name="rules[3][value][spu]"
                           value="">

                </div>
            </div>--}}
        </fieldset>
    </div>
</div>
{{--
<div class="form-group">
    <label class="col-sm-2 control-label">标签：</label>
    <div class="col-sm-10">
        {!! Form::text('base[tags]',  $discount->tags , ['class' => 'form-control form-inputTagator col-sm-10','id'=>'inputDiscountTags', 'placeholder' => '']) !!}
        <label>输入标签名称，按回车添加</label>
    </div>
</div>--}}
